# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: http://jabbas-overlay.googlecode.com/svn/portage/media-sound/libffado/libffado-2.0_rc1.ebuild 64 2009-01-25 20:04:26Z g.dziegielewski $

inherit versionator python qt3 qt4

MY_PV=$(replace_version_separator 2 '-')

DESCRIPTION="The FFADO project tries to provide open-source drivers for all FireWire based pro-audio devices"
HOMEPAGE="http://www.ffado.org"
SRC_URI="http://www.ffado.org/files/${PN}-${MY_PV}.tar.gz"
LICENSE="GPL-2 GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug bebob fireworks genericavc expat test"

RDEPEND="dev-util/scons
         >=dev-cpp/libxmlpp-2.13.0
         >=sys-libs/libraw1394-1.3.0
         >=media-libs/libiec61883-1.1.0
         >=dev-python/dbus-python-0.82.4"
DEPEND="${RDEPEND}"

src_unpack() {
	unpack ${A}
	mv ${PN}-${MY_PV}/* ${WORKDIR}
	rm -r ${PN}-${MY_PV}
}

get_additional_options() {
	echo "${MAKEOPTS}" | sed -e "s/.*\(-j[0-9]\+\).*/\1/"

	echo \
		PREFIX=/usr \
		DESTDIR=\"${D}\"

	echo DEBUG=no

}

do_scons() {
	local cmd=$1
	eval set -- $(get_additional_options)
	echo scons $(get_additional_options) ${cmd}

	scons "$@" ${cmd}
}

src_compile() {

	do_scons || die "scons make died"
}

src_install() {
	do_scons install || die "scons install died"
}
